package com.guojian.jdbc.sql;

import com.github.pagehelper.parser.CountSqlParser;
import com.guojian.jdbc.DBType;

//@Component
//@ConditionalOnProperty(value = "pagehelper.helperDialect", havingValue = "sqlserver")
public class SqlServerParser extends com.github.pagehelper.parser.SqlServerParser implements SqlParser {

	private final CountSqlParser countParser = new CountSqlParser();

	@Override
	public String getCountSql(String sql) {
		return countParser.getSmartCountSql(sql);
	}

	@Override
	public String getPageSql(String sql, Integer offset, Integer limit) {
		return super.convertToPageSql(sql, offset, limit);
	}

	@Override
	public DBType getDBType() {
		return DBType.sqlserver;
	}

}
